<template>
  <div class="content">
    <div class="text_content">
      <textarea rows="3" cols="20" placeholder="请把您的宝贵意见于此处" v-model="form.suggestContent"></textarea>
    </div>
    <div class="text_content">
      <p>客服邮箱：{{email}}</p>
    </div>
    <div class="btn_content">
      <button class="button_confirm btn_green f18 mt35" @click="clickMe()">确认提交</button>
    </div>
  </div>
</template>

<script>
  import SxSuggestApi from '@/api/manage/SxSuggestApi';
  import SxConfigApi from '@/api/manage/SxConfigApi';
  import {init} from '@/views/utils/common'

  export default {
    data() {
      return {
        email:'',
        form: {
          suggestUser: '',
          suggestContent: ''
        }
      }
    },
    mounted() {
      let that = this
      this.form.suggestUser = localStorage.getItem("token")
      SxConfigApi.get({configKey: 'PORTAL_EMAIL'}).then((res) => {
        that.email = res.configValue
      })
    },
    methods: {
      /**
       * 提交
       */
      clickMe() {
        let that = this
        SxSuggestApi.insert(this.form).then((res) => {
          this.$message({
            title: '成功',
            message: '提交成功，可以继续提意见哦',
            type: 'success',
            duration: 1000,
            onClose() {
              that.form.suggestContent = '';
            }
          })
        })
      },
    }
  }
</script>

<style scoped>
  @import "../../assets/css/iconfont.css";
  @import "../../assets/css/login_selfcenter.css";
  @import "../../assets/css/reset.css";
</style>
